from fastapi import FastAPI
import gradio as gr

CUSTOM_PATH = "/p1/"

app = FastAPI()


@app.get("/")
def read_main():
    return {"message": "This is your main app"}


io = gr.Interface(lambda x: "Ninhao, " + x + "!", "textbox", "textbox")
app = gr.mount_gradio_app(app, io, path=CUSTOM_PATH)

# uvicorn x00300_mount_within_fastapi:app --host 0.0.0.0 --port 7771 --reload
